Set a block timeout at least a jiffy ahead, to have same behaviour
as native Linux.
Signed-off-by: Keir Fraser <keir@xensource.com>
{
u64 alarm = 0;
int ret = 0;
+ unsigned long j;
/*
* This is safe against long blocking (since calculations are
* would first get locked out. It is safe against normal
* updates of jiffies since interrupts are off.
*/
- alarm = __jiffies_to_st(next_timer_interrupt());
+ j = next_timer_interrupt();
+ if (j < (jiffies + 1))
+ j = jiffies + 1;
+ alarm = __jiffies_to_st(j);
/* Failure is pretty bad, but we'd best soldier on. */
if ( HYPERVISOR_set_timer_op(alarm) != 0 )